#pragma once
#include "loadUtils.h"
/**
 * @brief Struct for storing order data
 */
struct OrderVars{
	char id[8];
	char date[8];
	char clientid[6];
	char deliverytype[10];
	char locker[20];
	char giftcard[30];
	char coupon[30];
};
/**
 * @brief Array of OrderVars structs, allocated dynamically later on
 */
struct OrderVars *orderdata;
int allocated;//amount allocated in memory
int ordercount;//actual number of elements
/**
 * @brief Load order file into memory
 *
 * @param filename
 *
 * @return return code
 */
int loadOrders(char const *filename);
/**
 * @brief save orderdata to file
 *
 * @param filename
 *
 * @return return code
 */
int writeOrders(char const *filename);
/**
 * @brief add a order to the vector, reallocates if needed
 *
 * @param n
 */
void addOrder(struct OrderVars n);
/**
 * @brief removes a order by index, find it yourself first ;)
 *
 * @param index
 */
void rmOrder(int index);
